#pragma once

#include "IXFrame.h"
#include "IXListDelegate.h"
#include "IXHeader.h"

#define NULL_ITEM (-1)

enum
{
    LCF_Sortable = HF_Sortable,
    LCF_Fixed = HF_Fixed,
};

/**
 *  IXListView Interface.
 *
 */
class ExportXSkinLib IXListView : public IXFrame
{
    DEF_INTERFACE(IXListView, _T("{D97096D5-B140-45fa-A1A4-40F34CB01B59}"));

public:

    // Column
    virtual int  STDMETHODCALLTYPE   InsertColumn(IN int nIndex, IN LPCTSTR szText) = 0;
    virtual int  STDMETHODCALLTYPE   InsertColumn(IN int nIndex, IN LPCTSTR szText, IN int nWidth) = 0;

    virtual void STDMETHODCALLTYPE   SetColumnFlags(IN int nIndex, IN DWORD dwFlags) = 0;
    virtual DWORD STDMETHODCALLTYPE  GetColumnFlags(IN int nIndex) = 0;

    virtual int  STDMETHODCALLTYPE   GetSortIndex() = 0;
    virtual BOOL STDMETHODCALLTYPE   GetSortAsc() = 0;

    virtual int  STDMETHODCALLTYPE   GetCurSel() = 0;
    virtual void STDMETHODCALLTYPE   SetCurSel(int nIndex) = 0;

    // Item
    virtual int  STDMETHODCALLTYPE   InsertItem(IN size_t nIndex) = 0;
    virtual void STDMETHODCALLTYPE   RemoveItem(IN size_t nIndex) = 0;
    virtual void STDMETHODCALLTYPE   RemoveAllItems() = 0;
    virtual void STDMETHODCALLTYPE   SetItemCount(IN size_t nCount) = 0;
    virtual size_t STDMETHODCALLTYPE GetItemCount() = 0;

    // Height
    virtual void STDMETHODCALLTYPE   SetNormalHeight(IN size_t nHeight) = 0;
    virtual void STDMETHODCALLTYPE   SetSelectedHeight(IN size_t nHeight) = 0;

    // ListDelegate
    virtual void STDMETHODCALLTYPE   SetListDelegate(IN IXListDelegate* pListDelegate, IN BOOL bAutoRemoveDelegate) = 0;

    virtual IXFrame* STDMETHODCALLTYPE GetItemFrame(IN size_t nItem, IN size_t nSubItem) = 0;

    // Background
    virtual void STDMETHODCALLTYPE   SetNormalBackgnd(IN IXDraw* pNormalBkg) = 0;
    virtual void STDMETHODCALLTYPE   SetHoverBackgnd(IN IXDraw* pHoverBkg) = 0;
    virtual void STDMETHODCALLTYPE   SetSelectedBackgnd(IN IXDraw* pSelectedBkg) = 0;

    // Visible Items
    virtual int  STDMETHODCALLTYPE   GetFirstVisibleIndex() = 0;
    virtual int  STDMETHODCALLTYPE   GetVisibleCount() = 0;

    // Update items
    virtual void STDMETHODCALLTYPE   UpdateAllItems() = 0;
    virtual void STDMETHODCALLTYPE   UpdateItem(IN size_t nItem) = 0;
};

